<?php
/**
 * @author: trongkhoi
 */
?>
<?php cs()->registerScriptFile($path . "/ckfinder/ckfinder.js") ?>
<a class="btn btn-success" onclick="BrowseServer();" style="margin-left:10px">
    <i class="icon-upload-alt"></i> <?= Yii::t('user', 'Select') ?></a>
<script type="text/javascript">
    function BrowseServer()
    {
        // You can use the "CKFinder" class to render CKFinder in a page:
        var finder = new CKFinder();
        finder.selectActionFunction = function(fileUrl, data) {
            document.getElementById('<?= 'x' . $field; ?>').value = fileUrl;
            document.getElementById('<?= 'prev_' . $field; ?>').setAttribute('src', fileUrl);
        }
        finder.popup();
    }
</script>